package test6;

/**
 * @title:
 * @description:
 * @Author 易俊杰
 * @data: 2022/8/5 15:49
 * @version: V1.0
 */
public class Demo11 {

    public static void main(String[] args) {

        TreeNode root = new TreeNode(3);
        root.left = new TreeNode(1);
        root.left.right = new TreeNode(2);
        root.right = new TreeNode(4);
        traverse(root, 1);
    }

    static void traverse(TreeNode root, int k) {
        if (root == null) return;
        traverse(root.left, k);
        System.out.println(root.val);
        traverse(root.right, k);
    }
}
